import request from '@/utils/request'

export default {
  // 1、讲师列表（条件查询分页）
  // current 当前页,limit 页面大小,teacherQuery 条件对象
  getTeacherListPage(current, limit, teacherQuery) {
    return request({
      url: `/eduService/edu-teacher/pageTeacherCondition/${current}/${limit}`,
      method: 'post',
      // teacherQuery条件对象 后端用Request-body获取数据
      // data表示把对象转换为json对象到接口中
      data: teacherQuery
    })
  },
  removeDataById(id) {
    return request({
      url: `/eduService/edu-teacher/${id}`,
      method: 'delete'
    })
  },
  addTeacher(teacher){
    return request({
      url:`/eduService/edu-teacher/addTeacher`,
      method:'post',
      data: teacher
    })
  },
  getTeacherInfo(id){
    return request({
      url:`/eduService/edu-teacher/getTeacher/${id}`,
      method:'get'
    })
  },
  updateTeacher(teacher){
    return request({
      url:`/eduService/edu-teacher/updateTeacher`,
      method:'post',
      data:teacher
    })
  }
}
